/**
 * @program: LeetCode
 * @description: LeetCode :
 * @author: WXY
 * @create: 2023-01-15 09:32
 * @Version 1.0
 **/
public class Num303_canConstruct {
    public static boolean canConstruct(String ransonNodte, String magezine) {
        int[] arr = new int[26];
        for (int i = 0; i < magezine.length(); i++) {
            arr[magezine.charAt(i) - 'a']++;
        }
        for (int i = 0; i < ransonNodte.length(); i++) {
            arr[ransonNodte.charAt(i) - 'a']--;
            if (arr[ransonNodte.charAt(i) - 'a'] < 0) {
                return false;
            }
        }
        return true;
    }


}
